import card.Card;
import card.CardDemo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-06-13
 * Time: 20:45
 */

public class CardTest {
    public static void main(String[] args) {
        //1.买52张牌
        System.out.println("买来52张牌");
        CardDemo cardDemo = new CardDemo();

        //调用返回值为List<Card>的，泛型方法
        List<Card> cardList = cardDemo.buyCard();
        System.out.println(cardList);

        System.out.println();
        System.out.println();

        //2.洗牌
        System.out.println("打乱后：");
        List<Card> cardList1 = cardDemo.shuffle(cardList);
        System.out.println(cardList1);

        System.out.println();
        System.out.println();

        //3.揭牌
        //注意：揭牌的删除是，顺序表里的覆盖
        List<List<Card>> cardList2 = cardDemo.playCard(cardList);
        for (int i = 0; i < cardList2.size(); i++) {
            System.out.println("玩家"+ (i+1) + "的牌: " + cardList2.get(i));
        }

        System.out.println();
        System.out.println("揭牌后剩下的牌");
        System.out.println(cardList1);
    }
}
